﻿<%@ codepage=65001%><% 'UTF-8%>
<%'检查是否登录%>
<!--#include file="../Include/checklogin.asp"-->
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<% '会员卡管理%>
<!--#include file="../Include/Common.All.asp"-->
<!--#include file="../Include/Conn.asp"-->
<% call OpenConn%>

<!--#include file="../Include/Common.Security.asp"-->
 
 
 

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>批量卡号导出</title>
 
</head>
	<%
		dim filetype,batchcode
						
		filetype=ReplaceBadChar(Trim(request("type")))
		batchcode=ReplaceBadChar(Trim(request("batchcode")))
		''	Response.Write filetype&"-----"
if "xls"=filetype then
 
Response.ContentType   =   "application/vnd.ms-excel"   
  Response.AddHeader   "Content-Disposition",   "attachment;   filename=CardCode_"&batchcode&".xls"  
   
  
  
 

%>

<body>
	
<table border="1">
  <tr>
    <td>卡号</td>
    <td>校验码</td>
    <td>批次</td>
    <td>批号</td>
    <td>出号时间</td>
  </tr>
<%
		''查询结果信息
		Dim rsObj,strSql
		set rsObj=Server.CreateObject("ADODB.Recordset")
		strSql = "SELECT  id, cardcode, yzm, zt, batch, remarks, batchcode, creattime  "
		strSql=strSql & "  FROM KH_XX   WHERE 1=2   "
		If (batchcode <> "") Then  strSql=strSql & " or KH_XX.batchcode = '" & batchcode & "'  "
		strSql=strSql & " ORDER BY cardcode  "	

			'''Response.Write strSql&"-----"


			rsObj.Open strSql, Conn, 1, 3			 
			do while not rsObj.eof
				%>
  <tr>
    <td>&nbsp;<%=Trim(rsObj("cardcode"))%></td>
    <td>&nbsp;<%=Trim(rsObj("yzm"))%></td>
    <td><%=Trim(rsObj("batch"))%></td>
    <td><%=Trim(rsObj("batchcode"))%></td>
    <td><%=Trim(rsObj("creattime"))%></td>
  </tr>
			<%
				rsObj.movenext
			loop 
			''关闭链接
			rsObj.close		
			
	end if
			%>
  
</table>
 
 
</body>
</html>
 <%
	call CloseConn
%>